import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);

export default new Router({
	routes: [{
			path: '/dashboard',
			redirect: '/dashboard'
		},
		{
			path: '/',
			redirect: '/ToolsIndex'
		},
		// 个人博客首页
		{
			path: '/',
			component: resolve => require(['../components/myfront/Home.vue'], resolve),
			meta: {
				title: '博客首页'
			},
			// 站长工具
			children: [
				// {
				// 	path: '/myfrontIndex',
				// 	name: 'myfrontIndex',
				// 	component: resolve => require(['../components/myfront/myfrontIndex.vue'], resolve),
				// 	meta: {
				// 		title: '首页'
				// 	}
				// }, {
				// 	path: '/Classification',
				// 	name: 'Classification',
				// 	component: resolve => require(['../components/myfront/Classification.vue'], resolve),
				// 	meta: {
				// 		title: '分类'
				// 	}
				// }, {
				// 	path: '/Archive',
				// 	name: 'Archive',
				// 	component: resolve => require(['../components/myfront/Archive.vue'], resolve),
				// 	meta: {
				// 		title: '归档'
				// 	}
				// }, {
				// 	path: '/Photo',
				// 	name: 'Photo',
				// 	component: resolve => require(['../components/myfront/Photo.vue'], resolve),
				// 	meta: {
				// 		title: '图片'
				// 	}
				// }, 
				{
					path: '/Learn',
					name: 'Learn',
					component: resolve => require(['../components/myfront/Learn.vue'], resolve),
					meta: {
						title: '技术学习'
					}
				}, {
					path: '/About',
					name: 'About',
					component: resolve => require(['../components/myfront/About.vue'], resolve),
					meta: {
						title: '关于自己'
					}
				}, {
					path: '/ArticleSpecialDetail',
					name: 'ArticleSpecialDetail',
					component: resolve => require(['../components/myfront/ArticleSpecialDetail.vue'], resolve),
					meta: {
						title: '分类专栏明细'
					}
				},
				{
					// 文章明细预览
					path: '/ArticleDetail',
					name: 'ArticleDetail',
					component: resolve => require(['../components/myfront/ArticleDetail.vue'], resolve),
					meta: {
						title: '文章预览',
						ArticleDetail: true
					}
				},
				{
					path: '/ToolsIndex',
					name: 'ToolsIndex',
					component: resolve => require(['../components/page/tools/ToolsIndex.vue'], resolve),
					meta: {
						title: '工具首页'
					}
				}, {
					path: '/QRcodeGeneration',
					name: 'QRcodeGeneration',
					component: resolve => require(['../components/page/tools/QRcodeGeneration.vue'], resolve),
					meta: {
						title: '条码/二维码生成'
					}
				}, {
					path: '/QRcodesGeneration',
					name: 'QRcodesGeneration',
					component: resolve => require(['../components/page/tools/QRcodesGeneration.vue'], resolve),
					meta: {
						title: '批量二维码生成'
					}
				}, {
					path: '/Base64Encoding',
					name: 'Base64Encoding',
					component: resolve => require(['../components/page/tools/Base64Encoding.vue'], resolve),
					meta: {
						title: 'Base64编码/解码'
					}
				}, {
					path: '/Md5Encryption',
					name: 'Md5Encryption',
					component: resolve => require(['../components/page/tools/Md5Encryption.vue'], resolve),
					meta: {
						title: 'MD5加密'
					}
				}, {
					path: '/SqlCodeFormat',
					name: 'SqlCodeFormat',
					component: resolve => require(['../components/page/tools/SqlCodeFormat.vue'], resolve),
					meta: {
						title: '代码格式化'
					}
				}, {
					path: '/WordsNumber',
					name: 'WordsNumber',
					component: resolve => require(['../components/page/tools/WordsNumber.vue'], resolve),
					meta: {
						title: '字数统计'
					}
				}, {
					path: '/JsonCodeCheck',
					name: 'JsonCodeCheck',
					component: resolve => require(['../components/page/tools/JsonCodeCheck.vue'], resolve),
					meta: {
						title: 'JSON格式校验'
					}
				}, {
					path: '/JsonCodeFormat',
					name: 'JsonCodeFormat',
					component: resolve => require(['../components/page/tools/JsonCodeFormat.vue'], resolve),
					meta: {
						title: 'JSON格式整理'
					}
				}, {
					path: '/NumMoney',
					name: 'NumMoney',
					component: resolve => require(['../components/page/tools/NumMoney.vue'], resolve),
					meta: {
						title: '数字转大写金额'
					}
				}, {
					path: '/Extranet',
					name: 'Extranet',
					component: resolve => require(['../components/page/tools/Extranet.vue'], resolve),
					meta: {
						title: '外网Ip内网Ip查询'
					}
				}, {
					path: '/Weather',
					name: 'Weather',
					component: resolve => require(['../components/page/tools/Weather.vue'], resolve),
					meta: {
						title: '天气查看'
					}
				}
			],
		},
		// 后台管理
		{
			path: '/',
			component: resolve => require(['../components/common/Home.vue'], resolve),
			meta: {
				title: '自述文件'
			},

			children: [{
					path: '/dashboard',
					name: 'dashboard',
					component: resolve => require(['../components/page/Dashboard.vue'], resolve),
					meta: {
						title: '系统首页'
					}
				}, {
					path: '/WriteArticles',
					name: 'WriteArticles',
					component: resolve => require(['../components/page/ArticlesManage/WriteArticles.vue'], resolve),
					meta: {
						title: '发布文章'
					}
				}, {
					path: '/MarkdownWriteArticles',
					name: 'MarkdownWriteArticles',
					component: resolve => require(['../components/page/ArticlesManage/MarkdownWriteArticles.vue'], resolve),
					meta: {
						title: 'Markdown发布文章'
					}
				}, {
					path: '/ArticleSearch',
					name: 'ArticleSearch',
					component: resolve => require(['../components/page/ArticlesManage/ArticleSearch.vue'], resolve),
					meta: {
						title: '文章浏览'
					}
				},
				{
					// 文章预览
					path: '/ArticleWebContent',
					name: 'ArticleWebContent',
					component: resolve => require(['../components/page/ArticlesManage/ArticleWebContent.vue'], resolve),
					meta: {
						title: '文章预览',
						ArticleWebContent: true
					}
				},
				{
					// 文章预览
					path: '/ArticleCategory',
					name: 'ArticleCategory',
					component: resolve => require(['../components/page/ArticlesManage/ArticleCategory.vue'], resolve),
					meta: {
						title: '文章类别',
					}
				},
				{
					// 文章分类
					path: '/ArticleSubcategory',
					name: 'ArticleSubcategory',
					component: resolve => require(['../components/page/ArticlesManage/ArticleSubcategory.vue'], resolve),
					meta: {
						title: '文章分类',
					}
				},
				{
					path: '/icon',
					name: 'icon',
					component: resolve => require(['../components/page/Icon.vue'], resolve),
					meta: {
						title: '自定义图标'
					}
				},
				{
					path: '/table',
					name: 'table',
					component: resolve => require(['../components/page/BaseTable.vue'], resolve),
					meta: {
						title: '基础表格'
					}
				},
				{
					path: '/tabs',
					name: 'tabs',
					component: resolve => require(['../components/page/Tabs.vue'], resolve),
					meta: {
						title: 'tab选项卡'
					}
				},
				{
					path: '/form',
					name: 'form',
					component: resolve => require(['../components/page/BaseForm.vue'], resolve),
					meta: {
						title: '基本表单'
					}
				},
				{
					// 富文本编辑器组件
					path: '/editor',
					name: 'editor',
					component: resolve => require(['../components/page/VueEditor.vue'], resolve),
					meta: {
						title: '富文本编辑器'
					}
				},
				{
					// markdown组件
					path: '/markdown',
					name: 'markdown',
					component: resolve => require(['../components/page/Markdown.vue'], resolve),
					meta: {
						title: 'markdown编辑器'
					}
				},
				{
					// 图片上传组件
					path: '/upload',
					name: 'upload',
					component: resolve => require(['../components/page/Upload.vue'], resolve),
					meta: {
						title: '文件上传'
					}
				},
				{
					// vue-schart组件
					path: '/charts',
					name: 'charts',
					component: resolve => require(['../components/page/BaseCharts.vue'], resolve),
					meta: {
						title: 'schart图表'
					}
				},
				{
					// 拖拽列表组件
					path: '/drag',
					name: 'drag',
					component: resolve => require(['../components/page/DragList.vue'], resolve),
					meta: {
						title: '拖拽列表'
					}
				},
				{
					// 拖拽Dialog组件
					path: '/dialog',
					name: 'dialog',
					component: resolve => require(['../components/page/DragDialog.vue'], resolve),
					meta: {
						title: '拖拽弹框'
					}
				},
				{
					// 国际化组件
					path: '/i18n',
					name: 'i18n',
					component: resolve => require(['../components/page/I18n.vue'], resolve),
					meta: {
						title: '国际化'
					}
				},
				{
					// 权限页面
					path: '/permission',
					name: 'permission',
					component: resolve => require(['../components/page/Permission.vue'], resolve),
					meta: {
						title: '权限测试',
						permission: true
					}
				},
				{
					path: '/404',
					name: '404',
					component: resolve => require(['../components/page/404.vue'], resolve),
					meta: {
						title: '404'
					}
				},
				{
					path: '/403',
					name: '403',
					component: resolve => require(['../components/page/403.vue'], resolve),
					meta: {
						title: '403'
					}
				},
				{
					path: '/donate',
					name: 'donate',
					component: resolve => require(['../components/page/Donate.vue'], resolve),
					meta: {
						title: '支持作者'
					}
				}
			]
		},
		{
			path: '/login',
			component: resolve => require(['../components/page/Login.vue'], resolve)
		},
		{
			path: '*',
			redirect: '/404'
		}
	]
})
